Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SSL Handshake Issue #12

Merged
merged 1 commit into from
Oct 11, 2018
Merged

Fix SSL Handshake Issue #12

merged 1 commit into from
Oct 11, 2018

Conversation

mddepew
Copy link

@mddepew mddepew commented Oct 8, 2018

PBS Kids has changed their page to now require SSL for all requests. The Plex plugin framework uses an old version of python and urllib2 that has issues with SSL, specifically SNI validation. Previously this issue was bypassed by making requests over http. This is no longer an option.

This work-around creates an SSL context that will not perform validation and uses it for all requests, preventing the handshake errors that the current plugin is getting.

This means that the SSL traffic could be vulnerable to man-in-the-middle attacks, but previously this traffic was entirely unencrypted, so I believe SSL with potential vulnerabilities is an acceptable solution.

I would not recommend using this solution for any plugin that is transmitting passwords or other sensitive information.

@sander1
Copy link
Member

sander1 commented Oct 11, 2018

This is the same "fix" I used for a couple other plugins as well. The only other workaround I know of is adding the requests library and start using that.

@sander1 sander1 merged commit 2bd903f into plexinc-plugins:master Oct 11, 2018
@mddepew
Copy link
Author

mddepew commented Oct 11, 2018

Including requests as a external lib in Libraries/Shared was my first approach, and it worked in the init.py code, but for some reason the URL handler service still couldn't import requests. Do external libraries for URL handler services go somewhere else? I've struggled to find good documentation of the plex plugin framework.

@sander1
Copy link
Member

sander1 commented Oct 16, 2018

Libraries go in Contents/Libraries/Shared and should be available for both the plugin code and the service code.

To import 3rd party libraries you need to add this to the plugin's Info.plist file:

<key>PlexPluginCodePolicy</key>
<string>Elevated</string>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants